﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Intel_Client_GUI
{
	
	public class DateTimeModel
	{
		
		public class TimeInfo
		{
			public TimeInfo(DateTime start,TimeSpan duration)
			{
				this.start = start;
				this.duration = duration;
			}
			public DateTime start;
			public TimeSpan duration;
		}
			
		public delegate void DateTimeChangeHandler(TimeInfo info);
		
		public event DateTimeChangeHandler OnTimeChanged;
		
		
		public DateTimeModel()
		{
			// 在此点下面插入创建对象所需的代码。
		}
		
		public TimeInfo TimeAndDuration
		{
			get
			{
				return t;
			}
			set
			{
				t = value;
                if(t!=null && this.OnTimeChanged!=null)
				    this.OnTimeChanged(t);
			}
				
		}

		private TimeInfo t=null;
	}
}